//
//  MSMessageCell.m
//  MS
//
//  Created by Yuan on 13-2-14.
//  Copyright (c) 2013年 He Yuan. All rights reserved.
//

#import "MSMessageCell.h"
#import "UIColor+ColorUtils.h"

@implementation MSMessageCell
@synthesize iconButton;
@synthesize aliasTipLable; //昵称
@synthesize aliasLable; //昵称
@synthesize timeLbl; //时间
@synthesize contentLbl;//第二行的内容


-(void)dealloc
{
    aliasLable = nil;
    aliasTipLable = nil;
    timeLbl = nil;
    contentLbl = nil;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        CGFloat margin_top = 7.0f;
        
        iconButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [iconButton setFrame:CGRectMake(10,10, 40,40)];
        iconButton.layer.cornerRadius = 2.0;
        [iconButton setUserInteractionEnabled:NO];
        iconButton.layer.masksToBounds = YES;
        iconButton.layer.borderColor = [UIColor colorWithWhite:0.0 alpha:0.1].CGColor;
        iconButton.layer.borderWidth = 1.0f;        
        [self.contentView addSubview:iconButton];
        
        aliasTipLable = [[UILabel alloc]initWithFrame:CGRectMake(60.0f, margin_top-4.0,30.0, 25.0f)];
        [aliasTipLable setTextColor:[UIColor grayColor]];
        [aliasTipLable setFont:FONT_NORMAL];
        [aliasTipLable setText:@"发给:"];
        [aliasTipLable setContentMode:UIViewContentModeScaleAspectFit];
        [aliasTipLable setBackgroundColor:[UIColor clearColor]];
        [aliasTipLable setAdjustsFontSizeToFitWidth:YES];
        [self.contentView addSubview:aliasTipLable];
        
        aliasLable = [[UILabel alloc]initWithFrame:CGRectMake(93.0f, margin_top-4.0, 130.0f, 25.0f)];
        [aliasLable setTextColor:[UIColor colorWithString:@"#f376a0"]];
        [aliasLable setFont:FONT_MIDDLE_BOLD];
        [aliasLable setContentMode:UIViewContentModeScaleAspectFit];
        [aliasLable setBackgroundColor:[UIColor clearColor]];
        [aliasLable setAdjustsFontSizeToFitWidth:YES];
        [self.contentView addSubview:aliasLable];
        
        timeLbl = [[UILabel alloc]initWithFrame:CGRectMake(240.0, margin_top-4.0,70.0f,25.0f)];
        [timeLbl setTextColor:[UIColor grayColor]];
        [timeLbl setFont:FONT_NORMAL];
        [timeLbl setContentMode:UIViewContentModeScaleAspectFit];
        [timeLbl setBackgroundColor:[UIColor clearColor]];
        [timeLbl setAdjustsFontSizeToFitWidth:YES];
        [self.contentView addSubview:timeLbl];
        
        contentLbl = [[UILabel alloc] initWithFrame:CGRectMake(62.0f,26.0f, 245.0f,30.0f)];
        [contentLbl setTextColor:[UIColor darkGrayColor]];
        [contentLbl setUserInteractionEnabled:NO];
        [contentLbl setFont:FONT_NORMAL];
        [contentLbl setBackgroundColor:[UIColor clearColor]];
        [self.contentView addSubview:contentLbl];
        
        // Initialization code
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
